package com.haiyuancloud.create.server.init.runner;

import com.haiyuancloud.common.core.utils.HaiyuanUtil;
import com.haiyuancloud.create.service.CreateScriptService;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author haiyuan
 */
@Component
@RequiredArgsConstructor
public class StartedUpRunner implements ApplicationRunner {

    private final ConfigurableApplicationContext context;
    private final Environment environment;

    @Override
    public void run(ApplicationArguments args) {
        if (context.isActive()) {
            HaiyuanUtil.printSystemUpBanner(environment);
//            CreateScriptService createScriptService = (CreateScriptService) context.getBean("com.haiyuancloud.create.service.impl.CreateScriptServiceImpl");
//            createScriptService.create();
        }
    }
}
